<?php

class ProductStorageController extends BaseController
{
	
	public function actionAdmin()
	{
		$model=new Product('search');
		$model->unsetAttributes();  // clear any default values
		
		$model->zp_state = 1;//未上架的产品
		$model->zp_status = 2;//审核通过
		
		if(isset($_GET['Product'])){
			$model->attributes=$_GET['Product'];
			if($_GET['Product']['cateid3']>0){
				$model->catgory_id = (int)$_GET['Product']['cateid3'];
			}elseif($_GET['Product']['cateid2']>0){
				$model->catgory_id = (int)$_GET['Product']['cateid2'];
			}elseif($_GET['Product']['cateid1']>0){
				$model->catgory_id = (int)$_GET['Product']['cateid1'];
			}
		}

		$this->render('admin',array(
			'model'=>$model,
		));
	}

}